import { _decorator, Component, Node, assetManager } from 'cc';
import { App } from './App';
import { GlobalConfig } from './global/GlobalConfig';
const { ccclass, property } = _decorator;

@ccclass('Main')
export class Main extends Component {

    @property(Node)
    ui_root: Node = null

    start() {
        App.ins.viewMgr.uiRoot = this.ui_root;
        App.ins.init();
        App.ins.start();

        if(GlobalConfig.DEBUG){
            this.exportToWindow();
        }

    }

    update(deltaTime: number) {
        
    }

    exportToWindow():void{
        /**便于调试 */
        window["my_assetManager"] = assetManager;
        window["my_App"] = App.ins;

        
    }
}

